/**
 * 
 */
package org.totalbeginner.tutorial;

import static org.junit.Assert.*;

import org.junit.Test;

/**
 * @author Ibraheem
 *
 */
public class PersonTest {

	/**
	 * Test method for {@link org.totalbeginner.tutorial.Person#Person()}.
	 */
	@Test
	public void testPerson() {
		Person p1 = new Person();
		assertEquals("Unknown name", p1.getName());
	}

	/**
	 * Test method for {@link org.totalbeginner.tutorial.Person#setName(java.lang.String)}.
	 */
	@Test
	public void testSetName() {
		Person p2 = new Person();
		p2.setName("Ibraheem");
		assertEquals("Ibraheem", p2.getName());

	}

	/**
	 * Test method for {@link org.totalbeginner.tutorial.Person#setMaximumBooks(int)}.
	 */
	@Test
	public void testSetMaximumBooks() {
		Person p3 = new Person();
		p3.setMaximumBooks(89);
		assertEquals(89, p3.getMaximumBooks());
	}
	
	/**
	 * Test method for {@link org.totalbeginner.tutorial.Person#toString()}.
	 */
	@Test
	public void testToString(){
		Person p4 = new Person();
		p4.setMaximumBooks(15);
		p4.setName("Ibraheem Abdullah");
		String expectedResult = "Ibraheem Abdullah (15)";
		assertEquals(expectedResult, p4.toString());
	}

}
